// pages/doctorhomepage/diseaseinfo/diseaseinfo.js

var app=getApp()
Page({
  data: {
  },
  onShareAppMessage: function () {
  },
  onLoad: function (e) {
    var that = this
    var patientname = wx.getStorageSync('patientname');
    console.log("patientname的值" + patientname);
    console.info('--------' + patientname);
    this.setData({
      patientname: patientname,
    }),
    console.log("patientname的值" + patientname); 

    wx.request({
      url: app.globalData.url + '/API/diseaseinfo?patientname=' + patientname,
        method: 'get',
        header: {
          'content-type': 'application/json'
        },
        success: function (res) {
          console.log(res.data);
          var list = res.data;
          if (list == null) {
            var toastText = '数据获取失败';
            wx.showToast({
              title: toastText,
              icon: '',
              duration: 2000
            });
          } else {
            that.setData({
              list: list
            })
          }
        },
        fail: function () {
          console.log("------------fail-------------");
        }
    })
  },

})